import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()){
            int n = in.nextInt();
            long x = in.nextLong();
            long y = 0;
            for (int i = 0; i < n; i++) {
                y = in.nextLong();
                if(x >= y){
                    x += y;
                }else {
                    x += check(x,y);
                }
            }
            System.out.println(x);
        }

    }
    public static long check(long n,long m){
        while (n != 0){
            long tmp = m % n;
            m = n;
            n = tmp;
        }
        return m;
    }
}